﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using DataAccessLayer;

namespace ServiceLayer
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IService
    {//login page
        [OperationContract]
        [WebInvoke(UriTemplate = "/Login", Method = "POST",
            RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        bool Login(User user);

        //welcome page
        [OperationContract]
        [WebGet(UriTemplate = "/Department/{userName}", ResponseFormat = WebMessageFormat.Json)]
        String GetDept(string userName);

        //welcome page
        [OperationContract]
        [WebGet(UriTemplate = "/Role/{userName}", ResponseFormat = WebMessageFormat.Json)]
        Role GetRole(string userName);

        //make requisition
        [OperationContract]
        [WebGet(UriTemplate = "/Category", ResponseFormat = WebMessageFormat.Json)]
        Category[] CategoryN();

        //make requisition
        [OperationContract]
        [WebGet(UriTemplate = "/CateNameList/{categoryName}", ResponseFormat = WebMessageFormat.Json)]
        Stationery[] ItemN(string categoryName);

        //make requisition
        [OperationContract]
        [WebInvoke(UriTemplate = "/ReqSubmit/{userName}", Method = "POST",
            RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        bool ReqSubmit(string userName, Req[] reqList);

        //Test
        [OperationContract]
        [WebGet(UriTemplate = "/Test", ResponseFormat = WebMessageFormat.Json)]
        User[] List();
        //Test
        [OperationContract]
        [WebInvoke(UriTemplate = "/LC", Method = "POST",
            RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        bool LC(User[] list);
    }

}